﻿using System;
using System.Threading;
using WhiteFlow.DevTrackingTool.UI.ViewModels;
using WhiteFlow.DevTrackingTool.UI.Views;

namespace WhiteFlow.DevTrackingTool.UI
{
    public static class Program
    {
        [STAThread]
        public static void Main(string[] args)
        {
            App app = new App();
            app.InitializeComponent();  // Load resources...
            
            MainView mainView = null;

            using (SplashViewModel splashViewModel = SplashView.ShowSplash())
            {
                splashViewModel.StatusText = "Initializing...";

                // Loading application modules...
                Thread.Sleep(2000); // Simulate delay... for now.

                mainView = new MainView();
                MainViewModel viewModel = new MainViewModel();
                mainView.DataContext = viewModel;

                splashViewModel.StatusText = "Initialized";

                Thread.Sleep(500);
            }

            app.Run(mainView);
        }
    }
}